<%@ page pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:include page="../common/top.jsp"></jsp:include>
<jsp:include page="../common/leftmenu.jsp"></jsp:include>

<%
	String path = request.getContextPath();
%>


<div class="fr" style="width: 780px">
	<div class="box_title">
		<i class="fa fa-table"></i>个人信息修改
	</div>
	<c:choose>
		<c:when test="${result.success eq false }">

			<div style="font-size: 18px;color:red;padding: 20px">提示信息：${result.msg
				}</div>
		</c:when>

		<c:when test="${result.success eq true }">


			<script type="text/javascript">
				alert("个人信息修改成功！");
				window.location.href = "<%=path%>/customer/help/user";
			</script>
		</c:when>


	</c:choose>
	<div class="box-content nopadding">
		<form id="changePasswordForm"
			action="customer/help/user/changePersonalInfoSave" method="post">
			<div style="display: none">
				<input type="hidden" name="id" value="${model.id }">
			</div>

			<table class="form-table">

			<%-- 	<tr>
					<td class="td1">所在部门：</td>
					<td class="td2"><input name="department" maxlength="200"
						value="${model.department }" style="width:80%"></td>
				</tr> --%>

			

				<tr>
					<td class="td1">手机（工作）：</td>
					<td class="td2"><input name="mobile" maxlength="20"
						value="${model.mobile }" style="width:80%"></td>

				</tr>
				<tr>
					<td class="td1">手机（非工作）：</td>
					<td class="td2"><input name="speciality" maxlength="20"
						value="${model.speciality }" style="width:80%"></td>

				</tr>

				<tr>
					<td class="td1">座机电话：</td>
					<td class="td2"><input name="tel" maxlength="20"
						value="${model.tel }" style="width:80%"></td>

				</tr>
				<tr>
					<td class="td1">手机短号：</td>
					<td class="td2"><input name="degree" maxlength="20"
						value="${model.degree }" style="width:80%"></td>

				</tr>
				<tr>
					<td class="td1">email：</td>
					<td class="td2"><input name="email" maxlength="100"
						value="${model.email }" style="width:80%"></td>

				</tr>
				<tr>
					<td class="td1">登陆密码：</td>
					<td class="td2"><input name="password" maxlength="100"
						value="${model.password }" type="password" style="width:80%"></td>

				</tr>

		<%-- 		<tr>
					<td class="td1">QQ：</td>
					<td class="td2"><input name="qq" maxlength="20"
						value="${model.qq }" style="width:80%"></td>

				</tr> --%>

<%-- 				<tr>
					<td class="td1">联系地址：</td>
					<td class="td2"><input name="linkaddress" maxlength="200"
						value="${model.linkaddress }" style="width:80%">
					</td>

				</tr> --%>
				<tr>
					<td colspan="2" style="text-align: center;padding:10px"><input
						id="submitBtn" class="nui-mainbtn BUTTON SUBMIT" type="button"
						onclick="javascript:return submitChangePassword();"
						value="&nbsp;&nbsp;提交&nbsp;&nbsp;"> <span id="submiting"
						style="display:none;color:red;font-size:14px">正在提交，请稍候......</span>
					</td>
				</tr>
			</table>
		</form>
	</div>
	
	<div class="box_title">
		<i class="fa fa-table"></i>服务地址管理
	</div>
	<div style="text-align: right;padding:5px 0px;"><a onclick="addAddress()" class="button">新增</a></div>
	<table class="table table-hover table-nomargin">
			<thead>
				<tr>
					<th style="width:250px">服务地址</th>
					<th style="width:70px">是否默认</th>
					<th style="width:70px">操作</th>
				</tr>
			</thead>
			<c:forEach var="item" items="${addressList }">
				<tr>
					<td>${item.address }</td>
				
					<td>
					  <c:choose>
					    <c:when test="${item.are_df eq true }">
					      <span>是</span>
					    </c:when>
					    <c:otherwise>
					      <span>否</span>
					    </c:otherwise>
					  </c:choose>
					</td>
					<td>
					  <a class="ui-link-inherit" href="javascript:editAddress('${item.id }')">编辑</a>
					  <a class="ui-link-inherit" href="javascript:deleteRecord('${item.id }')">删除</a>
					</td>
				</tr>
			</c:forEach>
		</table>
</div>
<script type="text/javascript">
function deleteRecord(id)
{
  $.ajax({
    url:"customer/help/user/deleteUserAddress?id="+id,
    success:function()
    {
      location.reload();
    }
  });
}
function addAddress()
{
  window.location.href="customer/help/user/userAddressEdit";
}
function editAddress(id)
{
  window.location.href="customer/help/user/userAddressEdit?id="+id;
}
function submitChangePassword() {
		$("#submitBtn").hide();
		$("#submiting").show();
		$("#changePasswordForm").submit();
		return true;
}
</script>
<jsp:include page="../common/bottom.jsp"></jsp:include>